package com.raycloud.action;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.raycloud.domain.User;
import com.raycloud.manager.UserMgr;

public class RegisterAction extends ActionSupport implements SessionAware{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private User user = new User();
	
	private UserMgr userMgr;
	
	private Map<String, Object> session;
	
	public String execute() throws Exception {
		userMgr.insertUser(user);
		session.put("user", user);
		return SUCCESS;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setUserMgr(UserMgr userMgr) {
		this.userMgr = userMgr;
	}

	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
}
